package cn.service.Impl;

import cn.dao.TopicDao;
import cn.domain.Forum;
import cn.domain.PageBean;
import cn.domain.Reply;
import cn.domain.Topic;
import cn.service.TopicService;
import cn.utils.HQLHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/4/5 0005.
 */
@Service
@Transactional
public class TopicServiceImpl implements TopicService {

    @Resource
    private TopicDao topicDao;

    @Override
    public List<Topic> Show(Long id) {
        return topicDao.Show(id);
    }

    @Override
    public List<Reply> reply(Long id) {
        return topicDao.reply(id);
    }

    @Override
    public Topic getById(Long id) {
        return topicDao.getById(id);
    }

    @Override
    public void Save(Topic topic) {
        topicDao.save(topic);
    }

    @Override
    public void Update(Topic topic) {
        topicDao.update(topic);
    }

    @Override
    public PageBean getPageBean(HQLHelper hqlHelper, int currentPage) {
        return topicDao.getPageBean(hqlHelper,currentPage);
    }
}
